//
//  KPDropDownMenuViewController.swift
//  KPBaseProject
//
//  Created by Kipp Dev on 2018/3/24.
//  Copyright © 2018年 Kipp. All rights reserved.
//

import UIKit
import YNDropDownMenu

class KPDropDownMenuViewController: KPBaseViewController {

    // MARK: - 可定制度很高，按需设置就行；
    lazy fileprivate var dropDownMenu: YNDropDownMenu = {
        let view1 = UIView()
        view1.backgroundColor = UIColor.Material.orange
        view1.frame = CGRect.init(x: 0, y: 0, width: Screen.width, height: 300)
        let view2 = UIView()
        view2.backgroundColor = UIColor.Material.purple
        view2.frame = CGRect.init(x: 0, y: 0, width: Screen.width, height: 300)
        let view = YNDropDownMenu(frame: CGRect.init(x: 0, y: 0, width: Screen.width, height: 38), dropDownViews: [view1,view2], dropDownViewTitles: ["列表1", "列表2"])

//        view.setImageWhen(normal: #imageLiteral(resourceName: "下-拉3"), selected: #imageLiteral(resourceName: "下-拉1"), disabled: nil)
        //view.setImageWhen(normal: UIImage(named: "arrow_nor"), selectedTintColor: FFA409, disabledTintColor: FFA409)
        //view.setImageWhen(normal: UIImage(named: "arrow_nor"), selectedTintColorRGB: "FFA409", disabledTintColorRGB: "FFA409")

        view.setLabelColorWhen(normal: mainTextColor, selected: mainColor, disabled: .gray)
        //            view.setLabelColorWhen(normalRGB: "000000", selectedRGB: "FFA409", disabledRGB: "FFA409")

        view.setLabelFontWhen(normal: .systemFont(ofSize: 14), selected: .systemFont(ofSize: 14), disabled: .systemFont(ofSize: 14))
        view.setLabelColorWhen(normal: mainTextColor, selected: UIColor.Material.blue500, disabled: detailTextColor)
        //            view.setLabel(font: .systemFont(ofSize: 12))

        view.backgroundBlurEnabled = true
        //            view.bottomLine.backgroundColor = UIColor.black
        view.bottomLine.isHidden = false

        // Add custom blurEffectView
        let backgroundView = UIView()
        backgroundView.backgroundColor = .black
        view.blurEffectView = backgroundView
        view.blurEffectViewAlpha = 0.7

        // Open and Hide Menu
        //            view.disabledMenuAt(index: 2)
        //view.showAndHideMenuAt(index: 3)

        view.setBackgroundColor(color: UIColor.white)

        return view
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(dropDownMenu)

    }

}
